package kr.hkit.powerjava.chapter12.poly;
abstract class ThreeDimshape extends Shape {
	public abstract void getVolume();
	
}// end of ThreeDimshape Class
class Shpere extends ThreeDimshape {
	double PI = 3.141592;
	int radius;
	double volume;
	
	public Shpere(int radius) {
		this.radius = radius;
	}
	public void getVolume(){
		System.out.println("원의 부피는 : " + (volume = (3.0/4*PI*radius*radius*radius)));
	}
}// end of Shpere Class
class Cube extends ThreeDimshape{
	double volume;
	int length;
	int width;
	int height;

	public Cube(int length, int width, int height) {
		this.length = length;
		this.width = width;
		this.height = height;
	}
	public void getVolume(){
		System.out.println("육면체의 부피는 : " + (volume = length * height * width));
	}
}// end of Cube Class
class Cylinder extends ThreeDimshape{
	double PI = 3.141592;
	double volume;
	int radius;
	int height;
	
	public Cylinder(int radius, int height) {
		this.radius = radius;
		this.height = height;
	}

	public void getVolume(){
		System.out.println("원기둥의 부피는 : "+ (volume = (radius * radius * PI* height)));
	}
}// end of Cylinder Class
